<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<table border="0" width="100%">
	<tr>
		<td><input name="id" type="hidden"
			value="<c:out value="${subject.id}"/>"> <input name="quesId"
			type="hidden" value="<c:out value="${subject.quesId}"/>">
		<div class="sbar">
		<table border="0">
			<tr>
				<td class="fname">编号:</td>
				<td><input name="code" size="20" maxlength="20"
					value="<c:out value="${subject.code}"/>"></td>
				<td class="fname">父题:</td>
				<td><select name="parentId">
					<option value="0">[- 顶级题目 -]</option>
					<c:forEach items="${allSubjects}" var="obj">
						<c:choose>
							<c:when test="${obj.id==subject.parentId}">
								<option selected value="<c:out value="${obj.id}"/>"><c:out
									value="[${obj.id}] ${obj.code}" /></option>
							</c:when>
							<c:otherwise>
								<option value="<c:out value="${obj.id}"/>"><c:out
									value="[${obj.id}] ${obj.code}" /></option>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</select></td>
				<td class="fname">顺序:</td>
				<td><input name="order" size="5"
					value="<c:out value="${subject.order}"/>"></td>
			</tr>
			<tr>
				<td class="fname">统计规则:</td>
				<td><select name="rule">
					<c:forEach items="${rules}" var="obj">
						<c:choose>
							<c:when test="${obj.value==subject.rule}">
								<option selected value="<c:out value="${obj.value}"/>"><c:out
									value="${obj.name}" /></option>
							</c:when>
							<c:otherwise>
								<option value="<c:out value="${obj.value}"/>"><c:out
									value="${obj.name}" /></option>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</select></td>
				<td colspan="4">
					<c:choose>
						<c:when test="${subject.canQuery}">
							<input name="canQuery" checked type="checkbox" value="true">
						</c:when>
						<c:otherwise><input name="canQuery" type="checkbox" value="true"></c:otherwise>
					</c:choose>
					可查询
					<c:choose>
						<c:when test="${subject.indb}">
							<input name="indb" checked type="checkbox" value="true">
						</c:when>
						<c:otherwise><input name="indb" type="checkbox" value="true"></c:otherwise>
					</c:choose>
					数据库出现
					<c:choose>
						<c:when test="${subject.inques}">
							<input name="inques" checked type="checkbox" value="true">
						</c:when>
						<c:otherwise><input name="inques" type="checkbox" value="true"></c:otherwise>
					</c:choose>
					问卷出现
				</td>
			</tr>
		</table>
		</div>
		<table border="0" width="100%">
			<tr>
				<td class="fname" width="10%">题干:</td>
				<td width="90%"><textarea name="title" rows="4" style="width:100%;"><c:out
					value="${subject.title}" /></textarea></td>
			</tr>
			<tr>
				<td class="fname">简称:</td>
				<td>
					字段名:
					<input name="name" size="20" maxlength="20" value="<c:out value="${subject.name}"/>">
					统计名:
					<input name="brief" size="20" maxlength="20" value="<c:out value="${subject.brief}"/>">
				</td>
			</tr>
			<tr>
				<td class="fname">类型:</td>
				<td>
					<table border="0" width="100%"><tr>
						<td>
							<select name="type">
								<c:forEach items="${subjectTypes}" var="obj">
									<c:choose>
										<c:when test="${obj.value==subject.type}">
											<option selected value="<c:out value="${obj.value}"/>"><c:out
												value="${obj.name}" /></option>
										</c:when>
										<c:otherwise>
											<option value="<c:out value="${obj.value}"/>"><c:out
												value="${obj.name}" /></option>
										</c:otherwise>
									</c:choose>
								</c:forEach>
							</select>
							枚举类型:
							<select name="enumType">
								<option value="0">&nbsp;</option>
								<c:forEach items="${consts}" var="obj">
									<c:choose>
										<c:when test="${obj.id==subject.enumType}">
											<option selected value="<c:out value="${obj.id}"/>"><c:out
												value="${obj.name}" /></option>
										</c:when>
										<c:otherwise>
											<option value="<c:out value="${obj.id}"/>"><c:out
												value="${obj.name}" /></option>
										</c:otherwise>
									</c:choose>
								</c:forEach>
							</select>
						</td>
						<td class="optionbar">
							&gt; <a href="javascript:void(0)">增加选项</a>
						</td>
					</tr></table>
				</td>
			</tr>
			<tr><td>&nbsp;</td><td class="options">
				<table width="100%" border="0" cellspacing=1 cellpadding=2>
					<tr align=center bgcolor="#DDDD66"><td width="90%">内容</td><td width="10%">扩充</td><td>&nbsp;</td></tr>
					<c:forEach items="${subject.options}" var="opt">
					<tr>
						<td><input class=grideditor name=optText value="<c:out value="${opt.text}"/>"></td>
						<c:choose>
							<c:when test="${opt.isext}">
								<td><input type=checkbox checked></td>
							</c:when>
							<c:otherwise>
								<td><input type=checkbox></td>
							</c:otherwise>
						</c:choose>
						<td><img class=icon16 src="<c:url value="/images/del.gif"/>"></td>
					</tr>
					</c:forEach>
				</table>
			</td></tr>
			<tr>
				<td class="fname">模板:<br>
				<em>(HTML)</em></td>
				<td><textarea name="pattern" rows="8" style="font-family:Courier New;width:100%;"><c:out
					value="${subject.pattern}" /></textarea></td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td class="sbar" align="right">
			&gt; <a href="javascript:void(0)">删除题目</a>
			&gt; <a href="javascript:void(0)">保存修改</a>
			<c:if test="${subject.id>0}">
			&gt; <a href="javascript:void(0)">增加下级题目</a>
			</c:if>
		</td>
	</tr>
</table>
</body>
</html>